package com.fxz.edu.ad.controller;

import com.fxz.edu.dto.PromotionSpaceDTO;
import com.fxz.edu.remote.AdRemoteService;
import com.fxz.edu.response.ResponseDTO;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author Fxz
 * @version 1.0
 * @date 2021-08-30 10:52
 */
@AllArgsConstructor
@RequestMapping("/ad")
@RestController
public class AdController {

    private final AdRemoteService adRemoteService;

    @GetMapping("/space/getAllSpace")
    public ResponseDTO getAllSpace(){
        List<PromotionSpaceDTO> allSpaces = adRemoteService.getAllSpaces();
        return ResponseDTO.success(allSpaces);
    }

}
